{% extends 'layout.html' %}


{% block main %}
<ol class="breadcrumb">
    <li><a href="/">管理首页</a></li>
    <li><span>内容修改</span></li>
</ol>
<h3>内容修改 -- {{content.title}}</h3>

<form method="post" >
    <div class="form-group">
        <label for="category">分类</label>
        <select name="category" id="category" class="form-control">
            {% for category in categoies %}
                {% if content.category._id.toString()==category._id.toString() %}
                   <option value="{{category._id.toString()}} " selected>{{category.name}}</option>
                {% else%}
                   <option value="{{category._id.toString()}}">{{category.name}}</option>
                {% endif%}
            {% endfor %}
        </select>
    </div>
    <div class="form-group">
        <label for="title">内容标题</label>
        <input type="text" class="form-control" name="title" value="{{content.title}}"
               id="title" placeholder="请输入内容标题">
    </div>
    <div class="form-group">
        <label for="description">简介</label>
        <input type="text" class="form-control" name="description" value="{{content.description}}"
               id="description" placeholder="请输入内容简介">
    </div>
    <div class="form-group">
        <label for="content">内容</label>
        <textarea row="15" type="text" class="form-control" name="content" value="{{content.content}}"
               id="content" placeholder="请输入内容"></textarea>
    </div>
    <button type="submit" class="btn btn-default">Submit</button>
</form>

{% endblock %}